// 封装角色模块相关的接口

import request from "@/utils/request"

// 获取角色数据
export const getRoleList = ({page,pagesize}) => {
    return request.get('/sys/role',{
        params: {
            page,
            pagesize
        }
    })
}

// 新增角色
export const addRole = (data) => {
    return request.post('/sys/role',data)
}

// 编辑修改角色
export const editRole = (data) => {
    return request.put(`/sys/role/${data.id}`, data)
}

// 删除角色
export const delRole = (id) => {
    return request.delete(`/sys/role/${id}`)
}

// 分配权限
export const setRoleAuth = (data) => {
    // console.log(data);
    return request.put('/sys/role/assignPrem', data)
}

// 获取角色详情
export const getRoleDetail = (id) => {
    return request.get(`/sys/role/${id}`)
}